package cn.itcast.onetomany;


import cn.itcast.jopo.Classes;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface OneToManyManager {

    @Select("select * from classes")
    @Results({
            @Result(id=true,column ="id",property = "id"),
            @Result(column = "name",property = "name"),
            @Result(property ="students",
                    many = @Many(select = "cn.itcast.onetomany.OneToManyStudent.findAll"),
                    column = "id")
    })
    public List<Classes> findAll(Integer id);
}
